package com.zhang.bingmei_incomeexpenditure.mapper;

/**
 * @author zsj
 * @description
 * @createDate 2025/10/17 15:04
 * @Entity com.zhang.bingmei_incomeexpenditure.mapper.entity.CommCityMapper
 */
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhang.bingmei_incomeexpenditure.entity.comCity.CommCity;
import com.zhang.bingmei_incomeexpenditure.entity.ie.CodeNameVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommCityMapper extends BaseMapper<CommCity> {
    // 继承BaseMapper，无需编写任何方法

    @Select("select * from comm_city")
    List<CommCity> getAllData();

    @Select("select DISTINCT level_code from comm_city where level_code LIKE '460000%' and deleted = 0")
    List<String> getAllProvinceCode();

    List<CommCity> selectDistinctLevelCodeByArea(@Param("area") String area);

    List<CodeNameVO> selectCodeAndNameByCodes(@Param("districtCodes") List<String> districtCodes);
}
